﻿using System.Collections.Generic;
using Caliburn.Micro;

namespace PocketBook.Tasks
{
    public static class Result
    {
        public static IEnumerable<IResult> AsEnumerable(this IResult result)
        {
            yield return result;
        }

        public static void Execute(this IResult result)
        {
            result.AsEnumerable().Execute();
        }

        public static void Execute(this IEnumerable<IResult> results)
        {
            Coroutine.BeginExecute(results.GetEnumerator());
        }
    }
}